package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.JiajiaCancelConfig;
import com.ruoyi.system.mapper.JiajiaCancelConfigMapper;
import com.ruoyi.system.service.IJiajiaCancelConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 取消订单原因Service业务层处理
 * 
 * @author knd
 * @date 2021-11-04
 */
@Service
public class JiajiaCancelConfigServiceImpl implements IJiajiaCancelConfigService
{
    @Autowired
    private JiajiaCancelConfigMapper jiajiaCancelConfigMapper;

    /**
     * 查询取消订单原因
     * 
     * @param id 取消订单原因主键
     * @return 取消订单原因
     */
    @Override
    public JiajiaCancelConfig selectJiajiaCancelConfigById(Long id)
    {
        return jiajiaCancelConfigMapper.selectJiajiaCancelConfigById(id);
    }

    /**
     * 查询取消订单原因列表
     * 
     * @param jiajiaCancelConfig 取消订单原因
     * @return 取消订单原因
     */
    @Override
    public List<JiajiaCancelConfig> selectJiajiaCancelConfigList(JiajiaCancelConfig jiajiaCancelConfig)
    {
        return jiajiaCancelConfigMapper.selectJiajiaCancelConfigList(jiajiaCancelConfig);
    }

    /**
     * 新增取消订单原因
     * 
     * @param jiajiaCancelConfig 取消订单原因
     * @return 结果
     */
    @Override
    public int insertJiajiaCancelConfig(JiajiaCancelConfig jiajiaCancelConfig)
    {
        return jiajiaCancelConfigMapper.insertJiajiaCancelConfig(jiajiaCancelConfig);
    }

    /**
     * 修改取消订单原因
     * 
     * @param jiajiaCancelConfig 取消订单原因
     * @return 结果
     */
    @Override
    public int updateJiajiaCancelConfig(JiajiaCancelConfig jiajiaCancelConfig)
    {
        return jiajiaCancelConfigMapper.updateJiajiaCancelConfig(jiajiaCancelConfig);
    }

    /**
     * 批量删除取消订单原因
     * 
     * @param ids 需要删除的取消订单原因主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaCancelConfigByIds(String ids)
    {
        return jiajiaCancelConfigMapper.deleteJiajiaCancelConfigByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除取消订单原因信息
     * 
     * @param id 取消订单原因主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaCancelConfigById(Long id)
    {
        return jiajiaCancelConfigMapper.deleteJiajiaCancelConfigById(id);
    }
}
